<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
  <head>
    <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
    <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
    <style>
      *{
        <#if .locale == "zh_CN">
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        <#elseif .locale == "zh_TW">
        font-family: NotoSans, NotoSansCJKtc, sans-serif;
        <#elseif .locale == "ja_JP">
        font-family: NotoSans, NotoSansCJKjp, sans-serif;
        <#elseif .locale == "ko_KR">
        font-family: NotoSans, NotoSansCJKkr, sans-serif;
        <#elseif .locale == "th_TH">
        font-family: NotoSans, NotoSansThai, sans-serif;
        <#else>
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        </#if>
      }
      body {
        width: 21.5cm;
        height: 14cm;
        margin: 0;
        padding: 0;
        background-color: #FFFFFF;
        text-align: center;
      }
      table {
        table-layout:fixed;
        margin: 0 5px;
      }
      table td {
        font-size: 15px;
        height: 20px;
        text-align: center;
        word-wrap: break-word;
         word-break: break-all;
      }
      table td p {
        width: 100%;
        height: auto;
        color: #000;
      }
      table .td1 {
        width: 5%;
      }
      table .td2 {
        width: 15%;
      }
      table .td3 {
        width: 10%;
      }
      table .td4 {
        width: 10%;
      }
      table .td5 {
        width: 9%;
      }
      table .td6 {
        width: 6%;
      }
      table .td7 {
        width: 6%;
      }
      table .td8 {
        width: 7%;
      }
      table .td9 {
        width: 7%;
      }
      table .td10 {
        width: 10%;
      }
      table .td11 {
        width: 5%;
      }
      table .td12 {
        width: 10%;
      }
      .leftBorder {
        border-left: 1px solid #000000;
      }
      .rightBorder {
        border-right: 1px solid #000000;
      }
      .topBorder {
        border-top: 1px solid #000000;
      }
      .bottomBorder {
        border-bottom: 1px solid #000000;
      }
      .border {
        border: 1px solid #000000;
      }
    </style>
	</head>
	<body>
    <#assign pageSize=((invAdjust.adjustDetail?size)/5)?ceiling ?number>

    <#list 1..pageSize as i>
    <#if i <= pageSize >
    <div style="height:100%">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr>
        <td  class="td1"></td>
        <td  class="td2"></td>
        <td  class="td3"></td>
        <td  class="td4"></td>
        <td  class="td5"></td>
        <td  class="td6"></td>
        <td  class="td7"></td>
        <td  class="td8"></td>
        <td  class="td9"></td>
        <td  class="td10"></td>
        <td  class="td11"></td>
        <td  class="td12"></td>
      </tr>
      <tr>
        <td colspan="12">
          <p style="text-align: center;font-size: 30px;font-weight: 600;line-height: 30px;">
            库存调整单
          </p>
        </td>
      </tr>
      <tr>
        <td colspan="12">
          <p style="text-align: right;font-size: 20px;font-weight: 600;line-height: 14px;">
            — — — ${invAdjust.subsidiary}
          </p>
        </td>
      </tr>
      <tr>
        <td colspan="5">
          <p style="text-align: left;font-size: 14px;line-height: 14px;">
            部门: <u>${invAdjust.department}</u>
          </p>
        </td>
        <td colspan="7">
          <p style="text-align: right;font-size: 14px;line-height:14px;">
            调拨日期：${invAdjust.date}
          </p>
          <p style="text-align: right;font-size: 14px;line-height:14px;">
            NO: ${invAdjust.tranid}
          </p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">序号</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">仓库</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">产品描述</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">物料编码</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">规格</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">颜色</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">色号</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">数量</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">单价</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">金额</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">单位</p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 12px;font-weight: 600; ">备注</p>
        </td>
      </tr>
      <#assign totalQty=0?number>
      <#assign totalAmount=0?number>
      <#list invAdjust.adjustDetail as adjustLine>
      <#if (adjustLine_index+1) gt 5*(i-1) && (adjustLine_index+1) lte 5*i>
      <#assign totalQty = totalQty+adjustLine.quantity?number>
      <#assign totalAmount = totalAmount+adjustLine.amount?number>
      <tr>
        <td class="td1 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.lineNumber}</p>
        </td>
        <td class="td2 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.location}</p>
        </td>
        <td class="td3 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.description}</p>
        </td>
        <td class="td4 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.item}</p>
        </td>
        <td class="td5 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.size}</p>
        </td>
        <td class="td6 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.color}</p>
        </td>
        <td class="td7 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.colorNumber}</p>
        </td>
        <td class="td8 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.quantity}</p>
        </td>
        <td class="td9 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.unitcost}</p>
        </td>
        <td class="td10 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.amount}</p>
        </td>
        <td class="td11 leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.unit}</p>
        </td>
        <td class="td12 leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 12px;  ">${adjustLine.memo}</p>
        </td>
      </tr>
    </#if>
      </#list>

    <#if i=pageSize && (invAdjust.adjustDetail?size)%5 != 0>
      <#list 1..(5-((invAdjust.adjustDetail?size)%5)) as j>
        <#if j <= (5-((invAdjust.adjustDetail?size)%5)) >
    <tr>
      <td class="td1 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  ">${invAdjust.adjustDetail?size + j}</p>
      </td>
      <td class="td2 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td3 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td4 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td5 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td6 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td7 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td8 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td9 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td10 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td11 leftBorder topBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
      <td class="td12 leftBorder topBorder rightBorder">
        <p style="text-align: center;font-size: 12px;  "></p>
      </td>
    </tr>
        </#if>
      </#list>
    </#if>
<tr>
  <td class="leftBorder topBorder" colspan="7">
    <p style="text-align: center;font-size: 12px;  ">小计</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${totalQty}</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  "></p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${totalAmount}</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${invAdjust.currency}</p>
  </td>
  <td class="leftBorder topBorder rightBorder">
    <p style="text-align: center;font-size: 12px;  "></p>
  </td>
</tr>
<tr>
  <td class="leftBorder topBorder" colspan="7">
    <p style="text-align: center;font-size: 12px;  ">总计</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${invAdjust.totalQty}</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  "></p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${invAdjust.totalAmount}</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 12px;  ">${invAdjust.currency}</p>
  </td>
  <td class="leftBorder topBorder rightBorder">
    <p style="text-align: center;font-size: 12px;  "></p>
  </td>
</tr>
      <tr>
        <td class="leftBorder topBorder rightBorder" colspan="12">
          <p style="width: 90%;text-align: right;font-size: 12px;  ">打印次数：${invAdjust.printTimes} 次</p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder bottomBorder" colspan="11">
          <table style="width: 100%;margin: 0;">
            <tr>
              <td colspan="4">
                <p style="text-align:left;font-size: 12px;  ">备注: ${invAdjust.memo}</p>
              </td>
            </tr>
            <tr>
              <td>
                <p style="text-align:left;font-size: 12px;  ">制表人:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;  ">发料人:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;  ">部门主管:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;  ">财务部:</p>
              </td>
            </tr>
          </table>
        </td>
        <td class="leftBorder topBorder rightBorder bottomBorder">
          <p style="text-align: center;font-size: 12px;  "></p>
        </td>
      </tr>
      <tr>
        <td colspan="12">
          <p style="text-align: left;font-size: 12px;  ">
            对加工商产生约束力之任何法律文件，均须经加工负责人或授权人签字方可生效
            <br></br>
            一式四联：第一联（白）：仓库留存联；第二联（蓝）：会计记账；第三联（黄）：加工商留存联；第四联（红）：收货部门留存
          </p>

        </td>
      </tr>
<tr>
  <td colspan="13">
    <p style="text-align: center;font-size: 12px;  ">
      ${i} / ${pageSize}
    </p>
  </td>
</tr>
    </table>
</div>
    </#if>
    </#list>
	</body>
</pdf>
